/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "opinion")
public class Opinion {

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "OPINION_ID", unique = true, nullable = false)
  private long opinionId;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "LOCATION_ID")
  private Location location;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "STUDENT_ID")
  private Student student;

  @Column(name = "CONTENT")
  private String content;

  public Opinion() {
  }

  public long getOpinionId() {
    return opinionId;
  }

  public void setOpinionId(long opinionId) {
    this.opinionId = opinionId;
  }

  public Location getLocation() {
    return location;
  }

  public void setLocation(Location location) {
    this.location = location;
  }

  public Student getStudent() {
    return student;
  }

  public void setStudent(Student student) {
    this.student = student;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }
}
